Skip to content

draftwise skills install: auto-detect harnesses on disk by default#59

Merged
4nkur merged 1 commit intomainfrom
skills-install-autodetect
Apr 29, 2026
Merged

draftwise skills install: auto-detect harnesses on disk by default#59
4nkur merged 1 commit intomainfrom
skills-install-autodetect

Conversation

@4nkur
Copy link
Copy Markdown
Owner

@4nkur 4nkur commented Apr 29, 2026

Summary

  • draftwise skills install (no --provider flag) now auto-detects which AI harnesses exist on the machine — checks ~/.claude / ~/.cursor / ~/.gemini at the chosen scope root via the new detectInstalledProviders export — and installs the standalone skill only to those. Same shape impeccable's install uses (which delegates to the vercel-labs/skills package and auto-detects with --all as the explicit override).
  • --provider=all is the explicit opt-in for the old "install everywhere" behavior; --provider=<name> still targets one harness regardless of detection. When auto-detect finds nothing, the command errors with a hint pointing at both override flags. Install logs a one-line "Detected harness(es): …" so the user sees why a particular set was picked when they didn't pass a flag.
  • skills help gains two new lines that print the auto-detect set for each scope, so users can see what install (no flag) would target without running it.
  • skills uninstall is intentionally left alone. Its existing "iterate every known dir, skip empty" behavior cleans up stale Draftwise installs whether or not the harness is still on disk — detection-on-uninstall would miss that case.
  • CLAUDE.md's "Standalone skill" section, the src/utils/ architecture line, and README's slash-command callout all updated. CHANGELOG [Unreleased] records the behavior change.

Test plan

  • npm test — 339 passing (up 5 from baseline: three for detectInstalledProviders, one for the new install error path / detected-set log line, two for the new skills help detection lines).
  • npm run lint — clean.
  • Manual smoke: node bin/draftwise.js skills install --help shows the new default in the usage block.
  • Manual smoke: node bin/draftwise.js skills help prints the new "Detected harnesses (user scope) / (project scope)" lines correctly on a machine with ~/.claude, ~/.cursor, ~/.gemini all present.
  • Reviewer to sanity-check on a machine with only one of the three harnesses installed: draftwise skills install should install only to that one and log Detected harness(es): <label>.
  • Reviewer to sanity-check the no-detection error path on a machine with none of the three: draftwise skills install should error with the --provider=all / --provider=<name> hint instead of silently writing nothing.

Previously installed SKILL.md to all three known harnesses' user-level skill dirs (`~/.claude/skills/draftwise/`, `~/.cursor/skills/draftwise/`, `~/.gemini/skills/draftwise/`) regardless of whether the user actually had Claude Code, Cursor, or Gemini CLI installed. Now `detectInstalledProviders` (new export from `src/utils/skill-providers.js`) checks which of `~/.claude` / `~/.cursor` / `~/.gemini` exist at the chosen scope root and installs only to those — same shape impeccable's install uses (which delegates to the `vercel-labs/skills` package and auto-detects with `--all` as the explicit override).

`--provider=all` is the explicit opt-in for the old "install everywhere" behavior; `--provider=<name>` still targets one harness regardless of detection. When auto-detect finds nothing the command errors with a hint pointing at both override flags. Install logs a one-line "Detected harness(es): …" so the user sees why a particular harness was picked when they didn't pass a flag. `skills help` gains two new lines — "Detected harnesses (user scope, --scope=user): …" and the project-scope equivalent — so the auto-detect set is visible without having to run install.

`skills uninstall` is intentionally left alone. Its existing "iterate every known dir, skip ones with nothing to remove" behavior solves a different problem: cleaning up stale Draftwise installs whether or not the harness is still on disk. Detection-on-uninstall would miss the "user removed Cursor but the Draftwise dir lingers in `~/.cursor/skills/`" cleanup case.

CLAUDE.md's "Standalone skill" section, the `src/utils/` line in the architecture overview, and README's slash-command callout updated to match. CHANGELOG `[Unreleased]` records the behavior change. 339/339 tests passing (up 5 from the baseline — three for `detectInstalledProviders`, one for the new install error path / detected-set log line, two for the new `skills help` detection lines).
@4nkur 4nkur merged commit 3cb750e into main Apr 29, 2026
2 checks passed
@4nkur 4nkur deleted the skills-install-autodetect branch April 29, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant